/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-01-30 11:01:15
 * @Description  : 用户激活科目相关接口
 */

import type {
  UserActiveExamCreateReq,
  UserActiveExamPageRes,
  UserActiveExamReq,
  UserActiveExamUpdateReq
} from '@/types/userActiveExam'
import request from '@/utils/request'

// 分页查询用户激活科目接口
export const getUserActiveExamByPage = (params?: UserActiveExamReq) => {
  return request.get<UserActiveExamPageRes>('/userActiveExam/list', { params })
}

// 分页查询用户激活科目接口
export const getAuthUserActiveExamByPage = (params?: UserActiveExamReq) => {
  return request.get<UserActiveExamPageRes>('/userActiveExam/auth/list', { params })
}

// 添加用户激活科目接口
export const createUserActiveExam = (data: UserActiveExamCreateReq) => {
  return request.post('/userActiveExam/create', data)
}

// 更新用户激活科目接口
export const updateUserActiveExam = (data: UserActiveExamUpdateReq) => {
  return request.put('/userActiveExam/update', data)
}

// 用户激活科目排序接口
export const sortUserActiveExam = (userActiveExamIds: string[]) => {
  return request.put('/userActiveExam/sort', { userActiveExamIds })
}

// 用户激活科目删除接口
export const delUserActiveExam = (userActiveExamIds: string[], picCode?: string) => {
  return request.delete('/userActiveExam/delete', { data: { userActiveExamIds, picCode } })
}
